﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace AETools.UI
{
    public partial class frmSelectField : Form
    {
        public int classfyField = 0;
        public int counts = 0;
        public int x = 0;
        public int y = 0;
        public frmSelectField()
        {
            InitializeComponent();
        }

        public frmSelectField(List<String>fields)
        {
            InitializeComponent();
            int i = 0;
            foreach(string str in fields)
            {
                this.classfyFieldComboBox.Items.Add(str);
                this.comboBox1.Items.Add(str);
                this.XFieldComboBox.Items.Add(str);
                this.YFieldComboBox.Items.Add(str);

                if (str.Contains("X"))
                    this.XFieldComboBox.SelectedItem = this.XFieldComboBox.Items[i];
                else if (str.Contains("Y"))
                    this.YFieldComboBox.SelectedItem = this.YFieldComboBox.Items[i];
                i++;
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            classfyField = classfyFieldComboBox.SelectedIndex;
            x = XFieldComboBox.SelectedIndex;
            y = YFieldComboBox.SelectedIndex;
            counts = comboBox1.SelectedIndex;
            this.DialogResult = DialogResult.OK;
        }
    }
}
